package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.UserTaskRecordsMapper;
import com.ruoyi.system.domain.UserTaskRecords;
import com.ruoyi.system.service.IUserTaskRecordsService;

/**
 * 任务记录Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-01-14
 */
@Service
public class UserTaskRecordsServiceImpl implements IUserTaskRecordsService 
{
    @Autowired
    private UserTaskRecordsMapper userTaskRecordsMapper;

    /**
     * 查询任务记录
     * 
     * @param recordId 任务记录主键
     * @return 任务记录
     */
    @Override
    public UserTaskRecords selectUserTaskRecordsByRecordId(Long recordId)
    {
        return userTaskRecordsMapper.selectUserTaskRecordsByRecordId(recordId);
    }

    /**
     * 查询任务记录列表
     * 
     * @param userTaskRecords 任务记录
     * @return 任务记录
     */
    @Override
    public List<UserTaskRecords> selectUserTaskRecordsList(UserTaskRecords userTaskRecords)
    {
        return userTaskRecordsMapper.selectUserTaskRecordsList(userTaskRecords);
    }

    /**
     * 新增任务记录
     * 
     * @param userTaskRecords 任务记录
     * @return 结果
     */
    @Override
    public int insertUserTaskRecords(UserTaskRecords userTaskRecords)
    {
        userTaskRecords.setCreateTime(DateUtils.getNowDate());
        return userTaskRecordsMapper.insertUserTaskRecords(userTaskRecords);
    }

    /**
     * 修改任务记录
     * 
     * @param userTaskRecords 任务记录
     * @return 结果
     */
    @Override
    public int updateUserTaskRecords(UserTaskRecords userTaskRecords)
    {
        return userTaskRecordsMapper.updateUserTaskRecords(userTaskRecords);
    }

    /**
     * 批量删除任务记录
     * 
     * @param recordIds 需要删除的任务记录主键
     * @return 结果
     */
    @Override
    public int deleteUserTaskRecordsByRecordIds(Long[] recordIds)
    {
        return userTaskRecordsMapper.deleteUserTaskRecordsByRecordIds(recordIds);
    }

    /**
     * 删除任务记录信息
     * 
     * @param recordId 任务记录主键
     * @return 结果
     */
    @Override
    public int deleteUserTaskRecordsByRecordId(Long recordId)
    {
        return userTaskRecordsMapper.deleteUserTaskRecordsByRecordId(recordId);
    }
}
